UNIX V6のuser構造体
user構造体は、実行中のプロセスに必要な情報を持つ
code:sys/user.h
struct user
{
int u_rsav2; /* save r5,r6 when exchanging stacks */ int u_fsav25; /* save fp registers */ /* rsav and fsav must be first in structure */
char u_segflg; /* flag for IO; user or kernel space */
char u_error; /* return error code */
char u_uid; /* effective user id */
char u_gid; /* effective group id */
char u_ruid; /* real user id */
char u_rgid; /* real group id */
int u_procp; /* pointer to proc structure */
char *u_base; /* base address for IO */
char *u_count; /* bytes remaining for IO */
char *u_offset2; /* offset in file for IO */ int *u_cdir; /* pointer to inode of current directory */
char u_dbufDIRSIZ; /* current pathname component */ char *u_dirp; /* current pointer to inode */
struct { /* current directory entry */
int u_ino;
} u_dent;
int *u_pdir; /* inode of parent directory of dirp */
int u_uisa16; /* prototype of segmentation addresses */ int u_uisd16; /* prototype of segmentation descriptors */ int u_ofileNOFILE; /* pointers to file structures of open files */ int u_arg5; /* arguments to current system call */ int u_tsize; /* text size (*64) */
int u_dsize; /* data size (*64) */
int u_ssize; /* stack size (*64) */
int u_sep; /* flag for I and D separation */
int u_qsav2; /* label variable for quits and interrupts */ int u_ssav2; /* label variable for swapping */ int u_signalNSIG; /* disposition of signals */ int u_utime; /* this process user time */
int u_stime; /* this process system time */
int u_cutime2; /* sum of childs' utimes */ int u_cstime2; /* sum of childs' stimes */ int *u_ar0; /* address of users saved R0 */
int u_prof4; /* profile arguments */ char u_intflg; /* catch intr from sys */
/* kernel stack per user
* extends from u + USIZE*64
* backward not to reach here
*/
} u;
/* u_error codes */